import request from '@/utils/request.js'

/**
 * 查询分页
 */
export const getList = (current, limit, search) => {
  return request({
    url: '/system/dict/type/list',
    method: 'GET',
    params: {
      ...search,
      current,
      limit
    },
  })
}

// 删除多个 （常用）
export const remove = (ids) => {
  return request({
    url: "/system/dict/type/remove",
    method: 'DELETE',
    params: {
      ids
    }
  })
}

/**
 * 修改
 */
export const update = (row) => {
  return request({
    url: '/system/dict/type',
    method: 'PUT',
    data: row,
  })
}

/**
* 获取详情数据
*/
export const getNotice = (id) => {
  return request({
    url: `/system/dict/type/${id}`,
    method: 'GET',
  })
}

/**
* 添加数据
*/
export const add = (row) => {
  return request({
    url: '/system/dict/type',
    method: 'POST',
    data: row,
  })
}

/**
 * 获取字典数据
 */
export const getDictData = (dictType) => {
  return request({
    url: `/dict/type/data/${dictType}`,
    method: 'GET',
  })
}